Repository navigation
storage: let LMDB implement the async storage traits - #415
alexskinner wants to merge 1 commit into
Conversation
Make LMDB usable on the async path by owning Arc<Environment> in LmdbTransaction, implementing the maybe_async storage traits as immediately-ready futures, and managing txn/cursor lifetimes through raw LMDB pointers. Sync behaviour is unchanged. Relax the lib.rs feature gate so async+lmdb builds, while async+rocksdb stays excluded. Mark the LMDB storage tests with maybe_async, convert the remove_range/range_rev/explicit-transaction checks, and add a Makefile/CI build for async+lmdb. Document the combination and add an async_lmdb example. Co-authored-by: Alex Skinner <alexskinner@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #415 +/- ##
==========================================
+ Coverage 93.08% 93.09% +0.01%
==========================================
Files 282 282
Lines 39885 39978 +93
==========================================
+ Hits 37125 37218 +93
Misses 2760 2760
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
In my view, the changes introduced to implement asynchronous support in LMDB compromise its inherent simplicity and clarity, while also negatively impacting performance to some extent. I do not believe that enabling asynchronous operation justifies modifying LMDB; there are likely better ways to achieve this. |
|
Thanks, understood, and agreed that LMDB should stay simple. For context, the goal was letting one async application use a local-file datasource alongside an object-store (SlateDB) one. We will do that outside core instead: either an async LMDB Storage implementation in our own driver crate, plugged in through build_with_storage, or SlateDB on a local filesystem object store. No changes to KiteSQL needed. Thanks for the review. |
Make LMDB usable on the async path so applications using async storage (such as SlateDB) can also open local LMDB databases in the same build:
Arc<Environment>inLmdbTransaction, implement themaybe_asyncstorage traits as immediately-ready futures, and manage txn/cursor lifetimes through raw LMDB pointers. Sync behaviour is unchanged.lib.rsfeature gate soasync+lmdbbuilds (whileasync+rocksdbstays excluded).maybe_async, add abuild-lmdb-asyncMakefile/CI target, document the combination indocs/features.md, and addexamples/async_lmdb.rs.